package com.gamificationlibrary.gamificationlibrary.badge;

import com.gamificationlibrary.gamificationlibrary.model.Player;

public class BadgeSimpleTypeTask extends BadgeSimple{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6915707451548238870L;
	private int numberTaskToPerformed;
	
	public BadgeSimpleTypeTask(BadgeStateLocked stateLocked, BadgeStateUnlocked stateUnlocked, BadgeStateWon stateWon, boolean locked,
			 int numberTaskToPerformed) {
		
		this.setStateLocked(stateLocked);
		this.setStateUnlocked(stateUnlocked);
		this.setStateWon(stateWon);
		this.setAchievements(numberTaskToPerformed);
		if(locked)
		{
		this.setCurrentState(stateLocked);
		}
		else
			this.setCurrentState(stateUnlocked);
	}

	@Override
	public boolean checkWon(Player p) {
		// TODO Auto-generated method stub
		if(p.getnumberofTimeTaskPerformed()==this.getAchievements())
		{
			return true;
		}
		else return false;
	}

	@Override
	public String getType() {
		// TODO Auto-generated method stub
		return BadgeSimple.typeTypeTask;
	}

	

}
